package org.example.controller;

import lombok.RequiredArgsConstructor;
import org.example.domain.ResponseResult;
import org.example.domain.dto.SpotListDto;
import org.example.domain.entity.Spot;
import org.example.service.SpotService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/spot")
@RequiredArgsConstructor
public class SpotController {

    private final SpotService spotService;

    @GetMapping("/home/hotSpots")
    public ResponseResult hotSpots(){

        return spotService.hotSpots();

    }

    @PostMapping("/getSpotList")
    public ResponseResult getSpotList(@RequestBody SpotListDto spotListDto){
        return spotService.getSpotList(spotListDto);
    }

    @PutMapping("/updateViewCount/{id}")
    public ResponseResult updateViewCount(@PathVariable Integer id){
        return spotService.updateViewCount(id);
    }

    @GetMapping("/getSpotDetail/{id}")
    public ResponseResult getSpotDetail(@PathVariable Integer id){
        return spotService.getSpotDetail(id);
    }
}
